<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  props: {
    info: { type: Object, required: true },
  },
});
</script>

<template>
  <view class="article-item">
    <image class="article-item-img" :src="info.pic_url" lazy-load />
    <view class="article-item-content">
      <view class="article-item-name">{{ info.title }}</view>
      <view class="article-item-guider">名导：{{ info.author_name }}</view>
    </view>
  </view>
</template>

<style lang="scss">
.article-item {
  display: flex;
  align-items: center;

  .article-item-img {
    flex-shrink: 0;
    width: 166rpx;
    height: 124rpx;
    border-radius: 20rpx;
  }

  .article-item-content {
    flex-grow: 1;
    min-width: 0;
    margin-left: 20rpx;
  }

  .article-item-name {
    height: 80rpx;
    margin-bottom: 8rpx;
    font-size: 28rpx;
    color: #333333;
    line-height: 40rpx;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  .article-item-guider {
    font-size: 24rpx;
    color: #ff7900;
    line-height: 36rpx;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
}
</style>